package com.csy.basethread;

import com.csy.util.ILogFactory;

public class Test006 implements ILogFactory {
    public static void main(String[] args) {
        log.info("主线程开始！");
        Thread thread1 = new Thread(() -> {
            for (int i = 0; i < 30; i++) {
                log.info("子线程1-i:{}", i);
            }
        });
        Thread thread2 = new Thread(() -> {
            thread1.start();
            try {
                thread1.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            for (int i = 0; i < 30; i++) {
                log.info("子线程2-i:{}", i);
            }
        });
        Thread thread3 = new Thread(() -> {
            thread2.start();
            try {
                thread2.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            for (int i = 0; i < 30; i++) {
                log.info("子线程3-i:{}", i);
            }
        });
        thread3.start();
    }
}
